{@
	$is_cmt = $oComment && $oComment->isExists();
	$is_par = !$is_cmt && $oSourceComment && $oSourceComment->isExists();
	$is_error = $BELUXE_MESSAGE_TYPE == 'error grant';
}
<div class="hx h2">
	<h2 cond="$is_cmt || $is_par">{$lang->comment.' '.$lang->no}: {$is_par?$oSourceComment->comment_srl.' - ':$comment_srl}</h2>
	<h2 cond="!$is_cmt">{$is_error?$lang->msg_input_password:$lang->new_comment}</h2>
</div>

<!--@if($is_error)-->
	<form cond="$BELUXE_MESSAGE_TYPE == 'error grant'" ruleset="checkPassword" action="./" method="post" class="ff secret">
		<input type="hidden" name="comment_srl" value="{$comment_srl}" />
		<input type="hidden" name="act" value="procBoardVerificationPassword" />
		<div class="origin">
			<input type="password" name="password" id="cpw" />
			<input type="submit" value="{$lang->cmd_input}" class="bn dark" />
			<a class="bn white" href="{$oEntry->getUrl('','mid',$mid,'act','','document_srl',$document_srl,'comment_srl',($parent_srl?$parent_srl:$comment_srl),'parent_srl','')}">{$lang->cmd_back}</a>
			<div>{$XE_VALIDATOR_MESSAGE}</div>
		</div>
	</form>
<!--@else-->
	{@
		$ds_nick = $ci['nick_name']->display == 'Y';
		$ds_user =	$ci['user_name']->display == 'Y';
	}

<block cond="$oSourceComment->isExists()">
	<div class="origin">{$lang->comment}:
		<strong>{cut_str((!$oSourceComment->get('member_srl')||$ds_nick||!$ds_user)?$oSourceComment->getNickName():$oSourceComment->getUserName(), $mi->nickname_length)}</strong>
	</div>
	<div class="origin">{$oSourceComment->getContentText(255)}</div>
</block>

<form ruleset="insertComment" action="./" method="post" class="ff tgo open">
	<input type="hidden" name="module_srl" value="{$mi->module_srl}" />
	<input type="hidden" name="act" value="procBoardInsertComment" />
	<input type="hidden" name="parent_srl" value="{$oSourceComment->comment_srl}" />
	<input type="hidden" name="document_srl" value="{$document_srl}" />
	<input type="hidden" name="comment_srl" value="{$oComment->comment_srl}" />
	<ul>
		<block cond="!$is_logged">
			<li cond="$mi->use_input_guest_info != 'N'">
				<label for="uName">{$lang->writer}</label>
				<input name="nick_name" type="text" id="uName" maxlength="80" value="{htmlspecialchars($oComment->get('nick_name'))}" />
			</li>
			<li>
				<block cond="$mi->use_input_guest_info == 'N'">
					<input type="hidden" name="nick_name" value="{$oThis->getIpaddress(1)}" />
				</block>
				<label for="uPw">{$lang->password}</label>
				<input name="password" type="password" id="uPw" />
			</li>
			<block cond="$mi->use_input_guest_info != 'N' && $mi->use_input_guest_info != 'S'">
				<li>
					<label for="uMail">{$lang->email_address}</label>
					<input name="email_address" type="text" id="uMail" maxlength="250" value="{htmlspecialchars($oComment->get('email_address'))}" />
				</li>
				<li>
					<label for="uSite">{$lang->homepage}</label>
					<input name="homepage" type="text" id="uSite" maxlength="250" value="{htmlspecialchars($oComment->get('homepage'))}" />
				</li>
			</block>
			<li class="hr"><hr /></li>
		</block>
		<block cond="$is_logged">
			<input type="hidden" name="nick_name" value="1" />
			<input type="hidden" name="password" value="1" />
		</block>
		<li>
			{@
				$t_dstus = explode(',', $mi->use_c_status);
				$status = $oComment->get('is_secret') == 'Y'?'SECRET':'PUBLIC';
			}
			<!--@if($is_logged || count($t_dstus) || $mi->use_anonymous=='S' || $mi->use_input_comment_writer != 'T')-->
			<label cond="count($t_dstus) > 1">
				<select name="status">
					<option loop="$t_dstus => $value" value="{$value}" selected="selected"|cond="$status == $value">{Context::getLang(strtolower($value))}</option>
				</select>
			</label>
			<input cond="count($t_dstus) === 1 && $t_dstus[0]" type="hidden" name="status" value="{$t_dstus[0]}" />
			<label cond="$is_logged">
				<input type="checkbox" name="notify_message" value="Y" checked="checked"|cond="$oComment->useNotify()" />
				{$lang->notify}
			</label>
			<label cond="$mi->use_anonymous=='S'">
				<input type="checkbox" name="anonymous" value="Y" checked="checked"|cond="($oComment->get('member_srl')<0)&&(($oComment->get('nick_name').$oComment->get('user_name')) == 'anonymousanonymous')" />
				{$lang->anonymous}
			</label>
			<label><input type="checkbox" name="use_html" value="Y" /> HTML</label>
			<!--@else-->
			<label for="rText">{$lang->comment}</label>
			<!--@endif-->
			<textarea name="content" cols="20" rows="5" id="rText">{$oComment->getContentText()}</textarea>
		</li>
	</ul>
	<div class="bna">
		<input name="" type="submit" accesskey="s" class="bn dark" value="{Context::getLang('cmd_'.($is_cmt?'update':'registration'))}" />
		<a class="bn white" href="{$oEntry->getUrl('','mid',$mid,'act','','document_srl',$document_srl,'comment_srl',($parent_srl?$parent_srl:$comment_srl),'parent_srl','')}">{$is_cmt?$lang->cmd_back:$lang->cmd_cancel}</a>
	</div>
</form>
<!--@endif-->